package com.itheima.exer.exercise.ex0924;
//递归求阶乘
public class Demo10 {
    public static void main(String[] args) {
        int result = getResult(5);
        System.out.println(result);
    }

    private static int getResult(int i) {
        if(i == 1){
            return 1;
        }else {
            return i*getResult(i-1);
        }
    }
}
